<script type="text/javascript">
    var specialText1 = "##$$##";
    var specialText2 = "##@@##";
    var keyId = (getUrlParam("keyId", url));
    fy_api.load_template({controller: $("#saveForm").attr("templateParam", "keyId=" + keyId), loading: true,initValue: true, loaded: loadedEdit});

    function loadedEdit(){
        $("#supplierProperty tbody").html("");
        var propertys = $("#propertyLstItems").val();
        var propertyLsts = propertys.split(specialText1);

        for(var i=0;i<propertyLsts.length;i++){
            var propertyLstItem = propertyLsts[i].split(specialText2);
            var propertyName = propertyLstItem[0];
            var propertyValue = propertyLstItem[1];

            if(propertyName == "loginName"){
                $("#supplierProperty>tbody").append('<tr><td align="center">短信平台登录名</td><td align="center">'+propertyName+'</td><td>'+propertyValue+'</td></tr>');
            }else if(propertyName == "loginPassword"){
                $("#supplierProperty>tbody").append('<tr><td align="center">短信平台密码</td><td align="center">'+propertyName+'</td><td>'+propertyValue+'</td></tr>');
            }else if(propertyName == "timeExpire"){
                $("#supplierProperty>tbody").append('<tr><td align="center">发送短信失效时间</td><td align="center">'+propertyName+'</td><td>'+propertyValue+'秒(默认24小时)</td></tr>');
            }else if(propertyName == "unitPrice"){
                $("#supplierProperty>tbody").append('<tr><td align="center">发送短信单价</td><td align="center">'+propertyName+'</td><td>'+propertyValue+'</td></tr>');
            }else if(propertyName == "voiceUnitPrice"){
                $("#supplierProperty>tbody").append('<tr><td align="center">发送语音短信单价</td><td align="center">'+propertyName+'</td><td>'+propertyValue+'</td></tr>');
            }else if(propertyName == "productid"){
                $("#supplierProperty>tbody").append('<tr><td align="center">产品id</td><td align="center">'+propertyName+'</td><td>'+propertyValue+'</td></tr>');
            }else if(propertyName == "autograph"){
                $("#supplierProperty>tbody").append('<tr><td align="center">发送短信签名</td><td align="center">'+propertyName+'</td><td>'+propertyValue+'</td></tr>');
            }else if(propertyName.length>0){
                $("#supplierProperty>tbody").append('<tr style="height: auto;"><td align="center">自定义属性</td><td align="center">'+propertyName+'</td><td>'+propertyValue+'</td></tr>');
            }
        }
    }
</script>
<form id="saveForm" templateUrl="supplier/get.do">
    <div id="divEdit">
        <input type="hidden" name="id" value="${id}"/>
        <input type="hidden"  id="propertyLstItems" name="propertyLstItems" value="${remark}"/>
    </div>
    <div id="supplierPropertys">
    </div>
    <div class="div-item" style="width: 100%;">
        <div class="div-label"><strong>基本信息</strong></div>
    </div>
    <div class="div-item">
        <div class="div-label"><span class="nullTip">*</span>供应商：</div>
        <select name="supplierNo" id="supplierNo" value="${supplierNo}" onchange="changeSupplier(this.value)" disabled="true">
            <option value="1">即时通</option>
            <option value="2">EMS</option>
            <option value="3">微网通联</option>
            <option value="5">上海助通</option>
        </select>
    </div>

    <div class="div-item">
        <div class="div-label"><span class="nullTip">*</span>应用平台：</div>
        <select name="appPlatform" id="appPlatform" value="${appPlatform}" disabled="true">
            <option value="BS">BS</option>
            <option value="CS">CS</option>
            <option value="仓配">仓配</option>
        </select>
    </div>
    <div class="div-item">
        <div class="div-label"><span class="nullTip">*</span>是否启用：</div>
        <select name="isUsed" id="isUsed" value="${isUsed}" disabled="true">
            <option value="Y">启用</option>
            <option value="N">不启用</option>
        </select>
    </div>

    <div class="div-item">
        <div class="div-label"><span class="nullTip">*</span>展示排序顺序：</div>
        <select name="viewSort" id="viewSort" value="${viewSort}" disabled="true">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="6">6</option>
            <option value="7">7</option>
            <option value="8">8</option>
            <option value="9">9</option>
        </select>
    </div>
    <div class="div-item" style="width: 100%;">
        <hr>
    </div>
    <div class="div-item" style="width: 100%;">
        <div class="div-label"><strong>供应商属性</strong></div>
    </div>

    <div class="div-item" style="width: 100%;height: auto">
        <table id="supplierProperty" border="1" width="80%">
            <thead>
            <tr style="height: auto">
                <th width="100px">属性描述</th>
                <th width="100px">属性名</th>
                <th width="100px">属性值</th>
            </tr>
            </thead>
            <tbody>


            </tbody>
        </table>
    </div>
</form>
<div class="form-buttons">
    <a id="btnBack" class="easyui-linkbutton c2" href="#" iconCls="icon-undo" onClick="parent.j_closeWin();">返回</a>
</div>